package org.jix.weblog.module.common.domain.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jix.weblog.module.common.domain.dos.UserRoleDO;

import java.util.List;

/**
 * @version 1.0
 * @Author Jix
 * @Date 2024/7/25 16:04
 * @注释
 */


public interface UserRoleMapper extends BaseMapper<UserRoleDO> {

    /**
     * 根据用户名查询
     * @param username
     * @return
     */
    default List<UserRoleDO> selectByUsername(String username) {
        LambdaQueryWrapper<UserRoleDO> queryWrapper = new LambdaQueryWrapper<>();
        queryWrapper.eq(UserRoleDO::getUsername, username);
        return selectList(queryWrapper);
    }
}
